package com.bym.controller;

import com.bym.stream.DefaultSendService;
import com.bym.stream.qinyi.QinyiSendService;
import com.bym.vo.QinyiMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <h1>构建消息驱动</h1>
 */
@Slf4j
@RestController
@RequestMapping("/message")
public class MessageController {

    @Autowired
    private DefaultSendService defaultSendService;

    @Autowired
    private QinyiSendService qinyiSendService;

    /**
     * <h2>默认信道</h2>
     */
    @GetMapping("/default")
    public void defaultSend() {
        defaultSendService.sendMessage(QinyiMessage.defaultMessage());
    }

    /**
     * <h2>自定义信道</h2>
     */
    @GetMapping("/qinyi")
    public void qinyiSend() {
        qinyiSendService.sendMessage(QinyiMessage.defaultMessage());
    }
}
